import React, { Component } from "react";
import "@wangeditor/editor/dist/css/style.css";
import { Editor, Toolbar } from "@wangeditor/editor-for-react";

export default class RichEditor extends Component {
  handleChange = (info) => {
    console.log(info.getHtml());
    this.props.onChange(info.getHtml());
  };
  render() {
    return (
      <div style={{ border: "1px solid #ccc", zIndex: 100, marginTop: "15px" }}>
        <Toolbar mode="default"></Toolbar>
        <Editor mode="default" onChange={this.handleChange}></Editor>
      </div>
    );
  }
}
